package gui.crud;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

public class ClassRegisterPanel extends AbstractRegisterPanel {

	private JComboBox<String> disciplinesBox;
	private JComboBox<Integer> hourField;
	private JComboBox<String> professorField;
	private JLabel disciplinesLabel;
	private JLabel durationLabel;
	private JLabel hoursLabel;
	private JLabel professorLabel;
	
	//O construtor correto devera receber um array ou lista de siglas das disciplinas para preencher a combobox
	public ClassRegisterPanel() {
		super("Criar Turma", 400, 300);
	}

	@Override
	protected void registerAct() {
		JOptionPane.showMessageDialog(this, "Cadastra a Turma", "Cadastro", JOptionPane.INFORMATION_MESSAGE);
	}

	@Override
	protected void setUpNewComponents() {
		disciplinesBox = new JComboBox<String>();
		hourField = new JComboBox<Integer>();
		professorField = new JComboBox<String>();
		disciplinesLabel = new JLabel("<html><i><b>Disciplina:</b></i></html>");
		durationLabel = new JLabel("<html><i><b>Duracao:</b></i></html>");
		hoursLabel = new JLabel("<html><i><b>Hora(s)</b></i></html>");
		professorLabel = new JLabel("<html><i><b>Professor:</b></i></html>");
		
		disciplinesBox.addItem("Disciplina Exemplo");
		disciplinesBox.addItem("Outra Disciplina Exemplo");
		disciplinesBox.addItem("Usa-se a sigla, ok?");
		
		//Ao inves de 7, deve-se pegar a duracao maxima permitida na disciplina
		for (int i = 0; i < 7; i++) {
			hourField.addItem(i);
		}
		
		//Pegar os professores!
		professorField.addItem("Professor tal");
		professorField.addItem("Professor outro");
		
		disciplinesBox.setBounds(210, 60, 150, 20);
		hourField.setBounds(60, 110, 60, 20);
		professorField.setBounds(210, 110, 120, 20);
		disciplinesLabel.setBounds(210, 38, 120, 20);
		durationLabel.setBounds(60, 88 , 120, 20);
		hoursLabel.setBounds(130, 110, 120, 20);
		professorLabel.setBounds(210, 88, 120, 20);
		
		
	}

	@Override
	protected void addNewComponents() {
		this.add(disciplinesBox);
		this.add(hourField);
		this.add(professorField);
		this.add(disciplinesLabel);
		this.add(durationLabel);
		this.add(hoursLabel);
		this.add(professorLabel);
		
	}

	
	
}
